package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.SysAlarm;
import com.ruoyi.system.mapper.SysAlarmMapper;
import com.ruoyi.system.service.ISysAlarmService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 告警信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-04-27
 */
@Service
public class SysAlarmServiceImpl implements ISysAlarmService
{
    @Resource
    private SysAlarmMapper sysAlarmMapper;

    /**
     * 查询告警信息
     *
     * @param alarmId 告警信息ID
     * @return 告警信息
     */
    @Override
    public SysAlarm selectSysAlarmById(String alarmId)
    {
        return sysAlarmMapper.selectSysAlarmById(alarmId);
    }

    /**
     * 查询告警信息列表
     *
     * @param sysAlarm 告警信息
     * @return 告警信息
     */
    @Override
    public List<SysAlarm> selectSysAlarmList(SysAlarm sysAlarm)
    {
        return sysAlarmMapper.selectSysAlarmList(sysAlarm);
    }

    /**
     * 新增告警信息
     *
     * @param sysAlarm 告警信息
     * @return 结果
     */
    @Override
    public int insertSysAlarm(SysAlarm sysAlarm)
    {
        return sysAlarmMapper.insertSysAlarm(sysAlarm);
    }

    /**
     * 修改告警信息
     *
     * @param sysAlarm 告警信息
     * @return 结果
     */
    @Override
    public int updateSysAlarm(SysAlarm sysAlarm)
    {
        return sysAlarmMapper.updateSysAlarm(sysAlarm);
    }

    /**
     * 删除告警信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysAlarmByIds(String ids)
    {
        return sysAlarmMapper.deleteSysAlarmByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除告警信息信息
     *
     * @param alarmId 告警信息ID
     * @return 结果
     */
    @Override
    public int deleteSysAlarmById(String alarmId)
    {
        return sysAlarmMapper.deleteSysAlarmById(alarmId);
    }
}
